﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SPMS.Log.ObjectFormatter
{
    /// <summary>
    /// 对象格式化器提供者
    /// </summary>
    /// <remarks>用于提供对象格式化器</remarks>
    /// <history>
    /// [zanezeng]               2009/10/21 9:04    创建
    /// </history>
    public interface IObjectFormatterProvider
    {
        /// <summary>
        /// 获得用于格式化给定类型对象的对象格式化器
        /// </summary>
        /// <param name="objectType">要被格式化的对象的对象类型</param>
        /// <returns>用于格式化给定类型对象的对象格式化器</returns>
        /// <remarks></remarks>
        /// <history>
        /// [zanezeng]               2009/10/21 9:05    创建
        /// </history>
        IObjectFormatter GetFormatter( Type objectType );

        /// <summary>
        /// 获得用于格式化给定类型对象的对象格式化器
        /// </summary>
        /// <typeparam name="T">要被格式化的对象类型泛型参数</typeparam>
        /// <returns>用于格式化给定类型对象的对象格式化器</returns>
        /// <remarks></remarks>
        /// <history>
        /// [zanezeng]               2010/1/13 14:09    创建
        /// </history>
        IObjectFormatter GetFormatter<T>();

        /// <summary>
        /// 获得用于格式化给定对象的对象格式化器
        /// </summary>
        /// <param name="obj">要被格式化的对象</param>
        /// <returns>用于格式化给定对象的对象格式化器</returns>
        /// <remarks></remarks>
        /// <history>
        /// [zanezeng]               2010/1/13 14:10    创建
        /// </history>
        IObjectFormatter GetFormatter( object obj );

        /// <summary>
        /// 将指定的对象格式化为字符串
        /// </summary>
        /// <param name="obj">要格式化的对象</param>
        /// <returns>给定对象的字符串描述信息</returns>
        /// <remarks></remarks>
        /// <history>
        /// [zanezeng]               2009/9/29 11:49    创建
        /// </history>
        string FormatObject( object obj );

        /// <summary>
        /// 将指定的对象格式化为字符串
        /// </summary>
        /// <param name="obj">要格式化的对象</param>
        /// <param name="format">对象的格式化字符串</param>
        /// <returns>给定对象的字符串描述信息</returns>
        /// <remarks></remarks>
        /// <history>
        /// [zanezeng]               2009/10/20 10:57    创建
        /// </history>
        string FormatObject( object obj, string format );

        /// <summary>
        /// 将指定的对象格式化为字符串
        /// </summary>
        /// <param name="obj">要格式化的对象</param>
        /// <param name="formatProvider">格式化提供者，提供用于检索控制格式化的对象的机制</param>
        /// <returns>给定对象的字符串描述信息</returns>
        /// <remarks></remarks>
        /// <history>
        /// [zanezeng]               2009/10/20 10:57    创建
        /// </history>
        string FormatObject( object obj, IFormatProvider formatProvider );

        /// <summary>
        /// 将指定的对象格式化为字符串
        /// </summary>
        /// <param name="obj">要格式化的对象</param>
        /// <param name="format">对象的格式化字符串</param>
        /// <param name="formatProvider">格式化提供者，提供用于检索控制格式化的对象的机制</param>
        /// <returns>给定对象的字符串描述信息</returns>
        /// <remarks></remarks>
        /// <history>
        /// [zanezeng]               2009/10/20 10:57    创建
        /// </history>
        string FormatObject( object obj, string format, IFormatProvider formatProvider );
    }
}
